package cn.sumpu.app.guoguojie.constant;

import java.util.HashMap;
import java.util.Map;

public enum SearchType {
	MEMBER("member", "找人"), PRODUCT("product", "找宝贝"), DOING("doing", "找微博"), OTHER(
			"other", "其他");
	private String value;
	private String label;

	private static Map<String, String> cache;

	static {
		cache = new HashMap<String, String>();
		cache.put(MEMBER.getValue(), MEMBER.getLabel());
		cache.put(PRODUCT.getValue(), PRODUCT.getLabel());
		cache.put(DOING.getValue(), DOING.getLabel());
		cache.put(OTHER.getValue(), OTHER.getLabel());
	}

	private SearchType(String value, String label) {
		this.value = value;
		this.label = label;
	}

	public String getValue() {
		return value;
	}

	public String getLabel() {
		return label;
	}

	public static String getLabelByValue(String value) {
		return cache.get(value);
	}
}
